package yagwl.service.demo;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

@SuppressWarnings("serial")
@Entity
@Table(name = "CART_LINE")
public class CartLineEntity implements Serializable {

  static final String entityCode = "LINE";

  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @Column(name = "CART_LINE_ID")
  private Long cartLineId;
  
  @Column(name = "PRODUCT_ID")
  private Long productId;
  
  @Column(name = "QUANTITY")
  private int quantity;

  @Transient
  private ProductEntity product;

  void setCartLineId(Long cartLineId) {
    this.cartLineId = cartLineId;
  }

  Long getCartLineId() {
    return cartLineId;
  }

  public void setProductId(Long productId) {
    this.productId = productId;
  }

  public Long getProductId() {
    return productId;
  }

  public void setQuantity(int quantity) {
    this.quantity = quantity;
  }

  public int getQuantity() {
    return quantity;
  }

  public void setProduct(ProductEntity product) {
    this.product = product;
  }

  public ProductEntity getProduct() {
    return product;
  }

}
